<!DOCTYPE html>
<html lang="en"
      xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
      layout:decorator="/admin/_layouts/default">
<head>
    <title>修改会员信息</title>
</head>
<body>
<div layout:fragment="content">
        <!-- 内容区域 -->
        <section class="content">
            <!-- Small boxes (Stat box) -->
            <div class="row">
                <div class="col-xs-12 i-navbar">
                    <a class="btn btn-primary" th:href="@{/admin/system/member/index.html}" data-pjax><i
                            class="fa fa-arrow-left"></i> 返回
                    </a>
                </div>
                <div class="col-xs-12">
                    <div class="box box-primary">
                        <div class="box-header with-border">
                            <h3 class="box-title">修改会员信息</h3>
                        </div>
                        <!-- /.box-header -->
                        <!-- form start -->
                        <form id="systemVariableForm"
                              th:action="@{/admin/system/member/update}"
                              method="POST">
                            <input type="hidden" name="id" th:value="${member.id}">
                            <div class="box-body">
                                <div class="form-group">
                                    <label for="nickname">昵称</label>
                                    <input class="form-control" id="nickname" name="nickname"
                                           placeholder="请输入昵称"
                                           th:value="${member.nickname}"
                                           type="text">
                                </div>
                                <div class="form-group">
                                    <label>
                                        <input type="checkbox" name="available"
                                               th:checked="${member.available}"
                                               checked> 是否启用
                                    </label>
                                </div>
                            </div>
                            <!-- /.box-body -->

                            <div class="box-footer">
                                <button class="btn btn-primary" type="submit">提交</button>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
            <!-- /.row -->
        </section>
        <!-- /内容区域 -->
        <script>
            var tree;
            $(function () {
                $('#systemVariableForm').ajaxForm({
                    dataType: 'json',
                    beforeSubmit: function (arr, form, option) {
                        form.find("button:submit").attr('disable', true);
                    },
                    success: function (data, statusText, xhr, form) {
                        if (data.code === 200) {
                            layer.msg(data.message, {icon: 1});
                        } else {
                            layer.msg(data.message, {icon: 2});
                        }
                        form.find("button:submit").attr('disable', false);
                    }
                });
            });
        </script>
    </div>
</body>
</html>
